package com.shangyueshang.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author JokeyFeng
 * @date: 2021/5/3
 * @project: shangyueshang
 * @package: com.shangyueshang.meta
 * @comment: 订单交易类型枚举
 */
@Getter
@AllArgsConstructor
public enum OrderType {
	/**
	 * 订单
	 */
	ORDER("Order", "正常订单"),
	/**
	 * 订单逆向收费
	 */
	ORDER_RETRO_CHARGE("Order_Retrocharge", "订单逆向收费"),
	/**
	 * 促销费用
	 */
	DEAL_FEE("Deal Fee", "促销费用"),
	/**
	 * 客户退货费
	 */
	FBA_Customer_Return_Fee("FBA Customer Return Fee", "客户退货费"),
	/**
	 * 秒杀费
	 */
	Lightning_DEAL_FEE("Lightning Deal Fee", "秒杀费"),
	/**
	 * 服务费
	 * 细分：广告费、店铺租金、Vine邀评、优惠券手续费
	 *
	 * @see OrderType#Cost_of_Advertising
	 * @see OrderType#Subscription
	 * @see OrderType#VINE_ENROLLMENT_FEE
	 * @see OrderType#Coupon_Redemption_Fee
	 */
	@Deprecated
	SERVICE_FEE("Service Fee", "服务费"),
	/**
	 * 广告费用
	 */
	Cost_of_Advertising("Cost of Advertising", "广告费用"),
	/**
	 * 店铺租金
	 */
	Subscription("Subscription", "店铺租金"),
	/**
	 * AWD费用
	 * 包含：
	 * AWD Transportation Fees->AWD运输费
	 * AWD Processing Fees->AWD处理费
	 * AWD Storage Fees->AWD仓储费
	 */
	AWD_Fees("AWD Fees", "AWD模式费用"),
	/**
	 * 优惠券手续费
	 */
	Coupon_Redemption_Fee("Coupon Redemption Fee", "优惠券手续费"),
	/**
	 * 入库缺陷费
	 */
	Inbound_Defect_Fee("Inbound Defect Fee", "入库缺陷费"),
	/**
	 * 入库配置费
	 */
	FBA_Inbound_Placement_Service_Fee("FBA Inbound Placement Service Fee", "入库配置费"),
	/**
	 * Send模式费用
	 * 包括：
	 * FBA international shipping customs charge->国际航运海关收费
	 * FBA international shipping charge->国际货运费
	 * FBA International Freight Shipping Charge->FBA国际货运代理费(亚马逊自营龙舟物流)
	 */
	Send_Shipping_Charge("Send shipping charge", "Send模式费用"),
	/**
	 * 退款
	 */
	REFUND("Refund", "退款"),
	/**
	 * 物流库存报销费用
	 */
	Adjustment("Adjustment", "物流库存报销费用"),
	/**
	 * 物流赔偿费用
	 */
	FEE_ADJUSTMENT("Fee Adjustment", "物流赔偿收入调整"),
	/**
	 * 库存管理费
	 * 包括：
	 * 仓储费、移除费、长期仓储费、交易费(FBA Transaction fees)
	 */
	FBA_INVENTORY_FEE("FBA Inventory Fee", "库存管理费"),
	/**
	 * 早期评论人
	 *
	 * @see OrderType#VINE_ENROLLMENT_FEE
	 */
	@Deprecated
	EARLY_REVIEWER_PROGRAM("Early Reviewer Program fee", "早期评论人"),
	/**
	 * AMZ官方邀评
	 */
	VINE_ENROLLMENT_FEE("Vine Enrollment Fee", "AMZ官方邀评"),
	/**
	 * 转账
	 */
	TRANSFER("Transfer", "转账"),
	/**
	 * 债务
	 */
	DEBT("Debt", "债务"),
	/**
	 * 清算
	 */
	LIQUIDATIONS("Liquidations", "清算"),
	
	;
	
	public final String type;
	
	public final String desc;
	
	/**
	 * 获取费用类型
	 *
	 * @return
	 */
	public static List<OrderType> feeTypes() {
		List<OrderType> list = new ArrayList<>();
		list.add(DEBT);
		list.add(DEAL_FEE);
		list.add(Adjustment);
		list.add(Subscription);
		list.add(FBA_INVENTORY_FEE);
		list.add(Coupon_Redemption_Fee);
		list.add(Cost_of_Advertising);
		list.add(FBA_Inbound_Placement_Service_Fee);
		list.add(Inbound_Defect_Fee);
		list.add(EARLY_REVIEWER_PROGRAM);
		list.add(VINE_ENROLLMENT_FEE);
		list.add(Lightning_DEAL_FEE);
		list.add(FEE_ADJUSTMENT);
		list.add(AWD_Fees);
		list.add(Send_Shipping_Charge);
		
		return list;
	}
	
	/**
	 * 获取费用类型
	 *
	 * @return
	 */
	public static List<String> feeTypeString() {
		return feeTypes().stream().map(OrderType::getType).collect(Collectors.toList());
	}
}
